package com.xintonghua.bussiness.ui.user.amount;

import android.os.Bundle;
import android.text.TextUtils;
import android.widget.Button;
import android.widget.EditText;

import com.xintonghua.bussiness.R;
import com.xintonghua.bussiness.base.BaseActivity;
import com.xintonghua.bussiness.event.BankEventBus;

import org.greenrobot.eventbus.EventBus;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 作者：wanxianyi
 * 时间：2018/4/1.
 * 包名：com.xintonghua.bussiness.ui.user.amount
 */

public class AddBankActivity extends BaseActivity {
    @BindView(R.id.tv_bank_name)
    EditText tvBankName;
    @BindView(R.id.tv_bank_number)
    EditText tvBankNumber;
    @BindView(R.id.btn_bind)
    Button btnBind;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_add_bank);
        ButterKnife.bind(this);
        onSimpleActionBar();
        setSimpleActionBar("添加账号");
        initUI();
    }

    @Override
    public void initUI() {
        super.initUI();

    }

    @OnClick(R.id.btn_bind)
    public void onViewClicked() {
        if (TextUtils.isEmpty(getStr(tvBankName))) {
            mToast("账户名不能为空！");
            return;
        }
        if (TextUtils.isEmpty(getStr(tvBankNumber))) {
            mToast("账号不能为空！");
            return;
        }
        EventBus.getDefault().post(new BankEventBus(getStr(tvBankName), getStr(tvBankNumber)));
        finish();
    }
}
